$(function() {

    $("form").submit(function() {
        var phone = $("input[name='phone']").val();
        var password = $("input[name='password']").val();

        $.post("/login", {
            "phone" : phone,
            "password" : password
        }, function(result) {
            $("#form_msg").html(result);
            $("#form_msg").css("color", "red");
            window.location.href="/index";
        });

        return false;
    })
})
